<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>管理中心</title>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/layui/css/layui.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/admin.css"/>
<style>
.layui-tab-item{-webkit-overflow-scrolling: touch;}
@media(max-width:992px){
	.layui-tab-item{overflow-y: scroll;}
}
</style>
</head>
<body>
<div class="main-layout" id='main-layout'> 
  <!--侧边栏-->
  <div class="main-layout-side">
    <div class="m-logo"> </div>
    <ul class="layui-nav layui-nav-tree" lay-filter="leftNav">
      {volist name="__MENU__.menu" id="vo"}
      <li class="layui-nav-item"> <a href="javascript:;" {if condition="$vo['url'] neq ''"}data-url="{:url($vo['url'])}" data-id='{$vo.id}' data-text="{$vo.title}"{/if}><i class="iconfont">{$vo.icon|default='&#xe607;'|htmlspecialchars_decode}</i>{$vo.title}</a>
        {if condition="!empty($vo['child'])"}
        <dl class="layui-nav-child">
          {volist name='vo.child' id='sub'}
          <dd><a href="javascript:;" data-url="{:url($sub['url'])}" data-id='{$sub.id}' data-text="{$sub.title}" id="left_menu_{$sub.id}"><span class="l-line"></span>{$sub.title}</a></dd>
          {/volist}
        </dl>
        {/if}
      </li>
      {/volist}
      
      
    </ul>
  </div>
  <!--右侧内容-->
  <div class="main-layout-container"> 
    <!--头部-->
    <div class="main-layout-header">
      <div class="menu-btn" id="hideBtn"> <a href="javascript:;"> <span class="iconfont">&#xe60e;</span> </a> </div>
      <ul class="layui-nav" lay-filter="rightNav">
        <li class="layui-nav-item"><a href="{:url('index/index/index')}" target="_blank" data-text="网站首页">网站首页</a></li>
        <li class="layui-nav-item"> <a href="javascript:;" data-url="{:url('Index/info')}" data-id='3' data-text="修改资料">修改资料</a> </li>
        <li class="layui-nav-item"><a class="logout" href="{:url('Publics/logout')}">退出</a></li>
      </ul>
    </div>
    <!--主体内容-->
    <div class="main-layout-body"> 
      <!--tab 切换-->
      <div class="layui-tab layui-tab-brief main-layout-tab" lay-filter="tab" lay-allowClose="true">
        <ul class="layui-tab-title">
          <li class="layui-this welcome">后台主页</li>
        </ul>
        <div class="layui-tab-content">
          <div class="layui-tab-item layui-show" style="background: #f5f5f5;"> 
            <!--1-->
            <iframe src="{:url('Index/main')}" width="100%" height="100%" name="iframe" scrolling="auto" class="iframe" framborder="0"></iframe>
            <!--1end--> 
          </div>
        </div>
      </div>
    </div>
  </div>
  <!--遮罩-->
  <div class="main-mask"> </div>
</div>
<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> 
<script type="text/javascript">
	var scope={
		link:"{:url('Index/main')}"
	}
	
	var module_path = "__STATIC__/admin/js/module/";
	
	$('.logout').click(function(){
		$.get($(this).attr('href'),function(data){
			layer.msg(data.msg);	
			setInterval(function(){
				window.location.href=data.url;	
			},2000);
		});
		return false;	
	});
	
</script> 
<script src="__STATIC__/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/admin/js/common.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/admin/js/main.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	function popNotice(i){
		if(i=i||{},window.Notification){
			if("granted"===Notification.permission){
				new Notification(i.title||"",{body:i.content||"",icon:i.avatar||'{$vars.web_url}__STATIC__/images/2.jpg'});
			}else {
				Notification.requestPermission(function (permission) {  
    				console.log(permission);
					if (permission != "denied") {
						new Notification(i.title||"",{body:i.content||"",icon:i.avatar||'{$vars.web_url}__STATIC__/images/2.jpg'});
					}else{
						layNotice(i);
					}
				})
			}
		}else{
			layNotice(i);
		}
	}
	
	function layNotice(i){
		$('<audio id="chatAudio"><source src="__STATIC__/media/notify.ogg" type="audio/ogg"><source src="__STATIC__/media/notify.mp3" type="audio/mpeg"><source src="__STATIC__/media/notify.wav" type="audio/wav"></audio>').appendTo('body');
		
		$('#chatAudio')[0].play();
		
		layui.use(['jquery','layer'], function() {
			layer = layui.layer;
							
			var win = layer.open({
				type:1,
				shade:false,
				offset: 'rb',
				area: ['300px', '200px'],
				title: i.title
				,content: '<div style="background:#3F3F3F; color:#fff; padding:20px; margin:10px; height:100px;"><a href="javascript:;" onclick="$(\'#left_menu_113\').click();" style="color:#fff;">'+i.content+' 【点击查看】</a></div>'
			});	
			
			var timer = setInterval(function(){ layer.close(win); clearInterval(timer)},5000);
		});		
	}
	
	//layNotice({title:'aaa',content:'bbbbb'});
	
	/*setInterval(function(){
		var url = "{:url('Ajax/msgtip')}";
		$.get(url,function(data){
			if(data.status==1){
				layNotice(data);
			}
		});	
	},1000);*/
</script>
</body>
</html>
